<script setup lang="ts">
import type { IState } from './type'
import useMicroStore from '@apps/_share/store/micro'
import {
  columns,
  schemas,
} from './config'

const state = reactive<IState>({
  schemas,
  tableData: Array.from({ length: 1000 }).fill(0).map(() => ({ url: 'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg' })),
  pagination: {
    page: 1,
    size: 20,
    total: 1000,
  },
})

const { getBus } = useMicroStore()

// function onSearch(model: any) {
//   console.log({ model })
// }

// function onReset(model: any) {
//   console.log({ model })
// }

// function onAdd() {

// }

// function onEdit(type: ButtonOperationType, row: any) {
//   console.log({
//     type,
//     row,
//   })
// }

getBus.on('close-tab-test', (params: any) => {
  console.log({ params })
})
</script>

<template>
  <ul>
    <li
      v-for="(row, index) in state.tableData"
      :key="index"
      class="p-16px h-300px"
    >
      <ElImage
        style="width: 200px;height: 200px;"
        :src="row.url"
      />
    </li>
  </ul>
</template>

<style lang="less">
li {
  content-visibility: auto;
  contain-intrinsic-size: 320px;
}
</style>
